<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>学生个人中心</title>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet"/>
    <style type="text/css">
        table {
            width: 90%;
            font-size: 16px;
            text-align: center;
            margin: 0 auto;
            border-collapse: separate;
            border-spacing: 0;
            border: 2px #e0e0e0;
            margin-top: 20px;
        }

        td {
            border-bottom: 2px solid #eaeaea;
        }

        .tr1 {
            background: #efefef;
            font-size: 14px;
            height: 50px;
        }

        .tr2 {
            height: 60px;
            border-bottom: 2px solid #eaeaea;
            font-size: 13px;
        }
        p {
            text-align: center;
            font-weight: bold;
            font-size: 28px;
        }

        button {
            margin-left: 1190px;
            width: 95px;
            height: 45px;
            border-radius: 5px;
            color: white;
            background-color: #33CCFF;
        }

        li {
            float: left;
            margin-top: 15px;
            margin-left: 10px;
        }

        .p1 {
            margin-left: 15px;
            color: #1e9fff;
        }

        /*a:link {color:#000000;} !* 未访问链接*!*/
        /*a:visited {color: #001200;}  !* 已访问链接 *!*/
        /*a:hover {color: #72fffd;}  !* 鼠标移动到链接上 *!*/

    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">

    <!-- header -->
    <div th:replace="~{commons/header::header}"></div>

    <!-- left -->
    <div th:replace="~{commons/studentLeft::left}"></div>
    <!-- 内容主体区域 -->
    <div class="layui-body">
        <div style="padding:20px 0px 45px 0px;">
            <p>请假申请</p>
            <a href="/to_sr_leave_insert">
                <button>新建申请表</button>
            </a>
            <table >
                <thead>
                <tr class="tr1">
<!--                    <th>序号&lt;!&ndash;leaveNum&ndash;&gt;</th>-->
                    <th>学号<!--stuId--></th>
                    <th>请假原因<!--sleaveReason--></th>
                    <th>去向<!--leaveDestination--></th>
                    <th>申请时间<!--leaveApplytime--></th>
                    <th>请假开始时间<!--leaveTime--></th>
                    <th>请假结束时间</th>
                    <th>状态<!--leaveApplystate--></th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr class="tr2" th:each="getSrLeaveList:${getSrLeaveList}">

<!--                    <td th:text="${getSrLeaveList.getLeaveNum()}"></td>-->
                    <td th:text="${getSrLeaveList.getStuId()}"></td>
                    <td th:text="${getSrLeaveList.getLeaveReason()}"></td>
                    <td th:text="${getSrLeaveList.getLeaveDestination()}"></td>
                    <td th:text="${getSrLeaveList.getLeaveApplytime()}"></td>
                    <td th:text="${getSrLeaveList.getLeaveTime()}"></td>
                    <td th:text="${getSrLeaveList.getLeaveTime2()}"></td>
                    <td th:if="${getSrLeaveList.getLeaveApplystate()}==1">审核中</td>
                    <td th:if="${getSrLeaveList.getLeaveApplystate()}==2">已通过</td>
                    <td th:if="${getSrLeaveList.getLeaveApplystate()}==3">已撤回</td>
                    <td th:if="${getSrLeaveList.getLeaveApplystate()}==4">未通过</td>
                    <td><a class="layui-btn layui-btn-danger layui-btn-xs"
                           th:href="@{'/sr_leave_delete/'+${getSrLeaveList.getLeaveNum()}}" th:onclick="return del()">删除</a>
                        <a class="layui-btn layui-btn-xs"
                           th:href="@{'/to_sr_leave_update/'+${getSrLeaveList.getLeaveNum()}}" >修改</a>
                    <a class="layui-btn layui-btn-primary layui-btn-xs"
                       th:href="@{'/sr_leave_detail/'+${getSrLeaveList.getLeaveNum()}}">详情</a>
                    </td>
                </tr>
                </tbody>
            </table>
            <div class="modal-footer no-margin-top" style="font-size: 15px">
                <div class="col-md-6" style="float: left;margin-top: 15px; margin-left: 400px;">
                    当前第 [[${pageInfo.pageNum}]]页,共 [[${pageInfo.pages}]] 页.共 [[${pageInfo.total}]] 条记录
                </div>

                <ul class="pagination pull-right no-margin">
                    <li th:if="${pageInfo.hasPreviousPage}">
                        <a th:href="'/sr_leave?pageNum=1'" class="p1">首页</a>
                    </li>

                    <li class="prev" th:if="${pageInfo.hasPreviousPage}">
                        <a th:href="'/sr_leave?pageNum='+${pageInfo.prePage}" class="p1">
                            <i class="ace-icon fa fa-angle-double-left">上一页</i>
                        </a>
                    </li>
                    <!--遍历条数-->
                    <li th:each="nav:${pageInfo.navigatepageNums}">
                        <a th:href="'/sr_leave?pageNum='+${nav}" th:text="${nav}" th:if="${nav != pageInfo.pageNum}"
                           class="p1"></a>
                        <span style="font-weight: bold;background: #6faed9;" th:if="${nav == pageInfo.pageNum}"
                              th:text="${nav}"></span>
                    </li>

                    <li class="next" th:if="${pageInfo.hasNextPage}">
                        <a th:href="'/sr_leave?pageNum='+${pageInfo.nextPage}" class="p1">
                            <i class="ace-icon fa fa-angle-double-right">下一页</i>
                        </a>
                    </li>

                    <li>
                        <a th:href="'/sr_leave?pageNum='+${pageInfo.pages}" class="p1">尾页</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<script th:src="@{/layui/layui.js}"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function () {
        var element = layui.element;
    });
</script>
<script>
    function del() {
        if (!confirm("确认要删除？")) {
            window.event.returnValue = false;
        }
    }
</script>
</body>
</html>